﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Gargoyle.ZZT
{
    public delegate bool TargetDelegate(Game g, int sender, ref int index);

    static class Targets
    {
        public static bool All(Game g, int sender, ref int index)
        {
            return (index < g.Things.Count);
        }

        public static bool Others(Game g, int sender, ref int index)
        {
            if (index < g.Things.Count)
            {
                if (index == sender)
                {
                    index++;
                    return (index < g.Things.Count);
                }
                return true;
            }
            return false;
        }

        public static bool Self(Game g, int sender, ref int index)
        {
            if (index > 0)
            {
                if (index <= sender)
                {
                    index = sender;
                    return true;
                }
            }
            return false;
        }
    }
}
